package at.jku.ce.georg;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class BOM_DB {
	
	HashMap<String,List<Part>>subparts = new HashMap<String,List<Part>>();
	
	
	public void generateBOM()
	{
		List<Part> list = new ArrayList<Part>();
		list.add(new Part("Motor", 100.0, false));
		list.add(new Part("Ventil", 10.0, false));
		list.add(new Part("Schlauch0.5", 15.0, false));
		list.add(new Part("Schraube10m", 0.24, false));
		subparts.put("PumpeXYZ1", list);
		list.clear();
		
		list.add(new Part("Motor", 100.0, false));
		list.add(new Part("Ventil", 10.0, false));
		list.add(new Part("Schlauch0.5", 15.0, false));
		list.add(new Part("Schraube7m", 0.24, false));
		list.add(new Part("Schraube2m", 0.24, false));
		subparts.put("PumpeABC2", list);
		list.clear();
		
		
	}
	
	
	public void add(String part, List<Part> parts){
		subparts.put(part, parts);
	}

	public List<Part> get(String part){
		return subparts.get(part);
	}
	
	public List<String> getParts(){
		ArrayList<String> list = new ArrayList<String>();
		list.addAll(subparts.keySet());
		return list;
	}

}
